<!-- 调剂报告 -->
<template>
	<view class="adjustReport">
		<view class="contents-index">
			<!-- 智慧调剂 -->
			<wisdom-index :isSticky="isSticky" @isWacth="watchBoxOtherTop" ref="wisdomIndex"></wisdom-index>
		</view>
		<u-back-top :z-index="100" :scroll-top="scrollTop"></u-back-top>
	</view>
</template>

<script>
	import wisdomIndex from "./components/wisdomIndex.vue"

	export default {
		components: {
			wisdomIndex
		},
		data() {
			return {
				flag: 0,
				schoolName: "",
				chooseSchoolCode: "",
				majorName: "",
				scrollTop: 0,
				isWatch: false, //是否可以监听筛选位置的滚动
				isSticky: false,
			}
		},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
			if (this.isWatch) {
				if (this.scrollTop >= (this.$refs.wisdomIndex.boxOtherTop + 40)) {
					this.isSticky = true;
				} else {
					this.isSticky = false;
				}
			}
		},
		onReachBottom() {
			if (this.$refs.wisdomIndex.tabIndex >= 3 ) {
				this.$refs.wisdomIndex.handleTfReachBottom();
			} else {
				this.$refs.wisdomIndex.sousuo()
			}
		},
		onLoad() {
			this.$nextTick(() => {
				this.$refs.wisdomIndex.getOnShow();
			})
		},
		onShow() {
			if (uni.getStorageSync('isEdit')) {
				this.$refs.wisdomIndex.handleNews();
				uni.removeStorageSync('isEdit');
			}
		},
		methods: {
			watchBoxOtherTop() {
				this.isWatch = true;
			},
			// 返回上一页
			returnPage() {
				uni.navigateBack(10);
			},
		},
	}
</script>

<style lang="scss" scoped>
	.adjustReport {
		background: rgba(235, 238, 239, 0.8);
		min-height: 100vh;

		// 顶部导航栏
		::v-deep .uni-navbar__header-btns-left,
		::v-deep .uni-navbar__header-btns-right {
			width: auto !important;
		}

		::v-deep .uni-navbar {
			/* #ifdef MP */
			// padding-top: 60rpx;
			background: #fff;
			/* #endif */
		}

		::v-deep .uni-navbar__header {
			/* #ifdef MP */
			position: relative;
			/* #endif */
		}

		::v-deep .uni-navbar__header-btns-right {
			/* #ifdef MP */
			position: absolute;
			right: 180rpx;
			background: #fff;
			top: 14rpx;
			/* #endif */
		}

		.nav-center {
			justify-content: center;
			width: 600rpx;
			/* #ifdef MP */
			width: 430rpx;
			/* #endif */

			.nav-tab {
				width: 150rpx;
				// height: 80rpx;
				margin-left: 40rpx;
				padding-bottom: 10rpx;
			}

			.nav-tab:first-child {
				margin-left: 0
			}

			.buttom-bold {
				border-bottom: 10rpx solid #F7DD5E;
				// border-radius: 44rpx;
			}
		}

		.contents-index {
			// margin: 40rpx 30rpx;
		}

	}
</style>